import request from '@/utils/request';

export function getProfileAPI() {
  return request({
    method: 'post',
    url: '/sys/profile',
  });
}

/** 获取员工列表 */
export const getUserListAPI = ({ page, size } = { page: 1, size: 10 }) => {
  return request({ url: '/sys/user', params: { page, size } });
};

/** 根据id，删除一条员工数据 */
export const delUserByIdAPI = (id: string) => {
  return request({ url: '/sys/user/' + id, method: 'delete' });
};

/** 获取角色列表 */
export const getRoleListAPI = ({ page, size } = { page: 1, size: 10 }) => {
  return request({ url: '/sys/role', params: { page, size } });
};

/** 根据角色id，删除一条角色 */
export const delRoleByIdAPI = (id: string) => {
  return request({ url: '/sys/role/' + id, method: 'delete' });
};

/** 获取权限列表 */
export const getAuthListAPI = () => {
  return request({ url: '/sys/permission' });
};

/** 根据id，删除一条权限 */
export const delAuthByIdAPI = (id: string) => {
  return request({ url: '/sys/permission/' + id, method: 'delete' });
};
